package com.ruoyi.classscoreonmonth.controller;

import com.ruoyi.classscoreonmonth.domain.ReportPolo;
import com.ruoyi.classscoreonmonth.service.impl.ClassReportImpl;
import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.core.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author 尹欣雨
 * @verdion 520
 * 00:07
 */
@RequestMapping("/report/report")
@RestController
public class ClassReportController {

    @Autowired
    private ClassReportImpl classReport;

    /*
    根据type获取这个存储信息的内容和图片
     */
    @Anonymous
    @GetMapping(value = "/getReadPortList/{type}")
    public AjaxResult getReadPortList(@PathVariable("type") String type){
        return AjaxResult.success(classReport.selectReadPortListByType(type));
    }

    /**
     * 获取all信息
     */
    @Anonymous
    @GetMapping
    public AjaxResult getNotice(){
        return AjaxResult.success(classReport.getAllList());
    }

    /**
     * 修改信息
     */
    @Anonymous
    @PutMapping
    public AjaxResult updateNotice(@RequestBody ReportPolo reportPolo){
        return AjaxResult.success(classReport.updateNotice(reportPolo));
    }

}
